<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<style>
    /*startStyle*/
    .print-title {
        padding-top: 5px;
        font-size: 16px;
        font-weight: 600;
        letter-spacing: 5px;
    }

    .print-title-sec {
        font-size: 26px;
        font-weight: 600;
        /*border-bottom: 1px solid;*/
        /*padding-bottom: 5px;*/
        margin-top: 5px;
        letter-spacing: 4px;
        font-family: '宋体';
    }

    .print-table {
        width: calc(100%);
        margin-top: 10px;
    }

    .print-table tbody td {
        font-size: 14px;
        padding-left: 5px;
        line-height: 30px;
    }

    .print-table thead td {
        background-color: #EBF3FE;
        font-weight: bold;
        color: #333333;
        font-size: 14px;
        padding-left: 5px;
        line-height: 30px;
    }

    .print_label {
        border: none;
        color: #333333;
        font-size: 14px;
    }

    .print_value {
        border: none;
        color: #666666;
        font-size: 14px;
        padding: 2px;
        text-align: left;
    }

    .print-table-border td {
        border: 1px solid #000000;
    }

    /*endStyle*/
</style>
<%--    图片 or 机构名--%>
<div style="padding: 25px;">
    <div style="text-align:center;">
        <c:if test="${institutionInfo.institutionCode=='1000106'}">
            <img style="width: calc(80%);" src="${contextPath}/assets/image/dialysis_shenshan.jpg">
        </c:if>
        <c:if test="${institutionInfo.institutionCode!='1000106'}">
            <div class="print-title">${institutionInfo.institutionName}</div>
        </c:if>
        <div class="print-title-sec">透析方案</div>
        <hr>
    </div>

    <div>
        <table class="print-table">
            <tbody>
            <tr>
                <td class="print_label">患者姓名：</td>
                <td class="print_value">${patient.patientName}</td>
                <td class="print_label">住院号：</td>
                <td>${patient.inpatientNum}</td>
            </tr>
            <tr>
                <td class="print_label">门诊号：</td>
                <td>${patient.outpatientNum}</td>
                <td class="print_label">性别：</td>
                <td>${patient.sexName}</td>
            </tr>
            <tr>
                <td class="print_label">年龄：</td>
                <td>${patient.age}岁</td>
                <td class="print_label">BMI：</td>
                <td>${patient.BMI}</td>
            </tr>
            <tr>
                <td class="print_label">置管日期：</td>
                <td>${patient.operationDate}</td>
                <td class="print_label">透析月：</td>
                <td>${patient.dialysisMonth}</td>
            </tr>
            <tr>
                <td class="print_label" colspan="2"
                    style="font-size: 16px; padding:10px 0px 10px 5px;font-weight: bold; ">
                    开立时间：${dialysisScheme.schemeDate}</td>
                <td class="print_label" colspan="2"
                    style="font-size: 16px; padding:10px 0px 10px 5px;font-weight: bold; ">
                    开立医生：${dialysisScheme.createDoctorName}</td>
            </tr>
            <c:if test="${pdSchemeMode=='2'}">
                <tr>
                    <td class="print_label">干腹体重：</td>
                    <td>${dialysisScheme.dryAbdomenWeight}kg</td>
                    <td class="print_label">湿腹体重：</td>
                    <td>${dialysisScheme.wetAbdomenWeight}kg</td>
                </tr>
                <tr>
                    <td class="print_label">腹膜透析导管类型：</td>
                    <td>${dialysisScheme.catheterTypeFinal}</td>
                </tr>
                <tr>
                    <td class="print_label">治疗模式：</td>
                    <td>${dialysisScheme.dialysisModeFinal}</td>
                    <td class="print_label">透析液类型：</td>
                    <td>${dialysisScheme.dialyzateTypeFinal}</td>
                </tr>

                <tr>
                    <td class="print_label">每日交换次数：</td>
                    <td>${dialysisScheme.apdDailyExchangeTimesFinal}次</td>
                </tr>
            </c:if>
            <c:if test="${pdSchemeMode=='1'}">
                <%--<tr>
                    <td class="print_label">是否白天留腹：
                        <c:if test="${dialysisScheme.abdominalRetention == '0'}">
                            否
                        </c:if>
                        <c:if test="${dialysisScheme.abdominalRetention == '1'}">
                            是
                        </c:if>
                    </td>
                </tr>--%>
            </c:if>
            </tbody>
        </table>
        <c:if test="${pdSchemeMode=='2'}">
            <table class="layui-table">
                <thead>
                <tr>
                    <th>次序</th>
                    <th>灌入量（L）</th>
                    <th>透析液类型</th>
                    <th>透析液浓度</th>
                    <th>钙离子浓度</th>
                    <c:if test="${!fn:contains(businesConfig, '101')}">
                        <th>渗透压（mOsmol/L）</th>
                    </c:if>
                    <th>留腹时间（H）</th>
                </tr>
                </thead>
                <tbody>
                <c:forEach items="${dialysisScheme.orders}" var="order">
                    <tr>
                        <td class="color999">${order.order}</td>
                        <td>${order.da}</td>
                        <td>${order.dialyzateTypeFinal}</td>
                        <td>${order.dialyzateConcentrationFinal}</td>
                        <td>${order.calciumIonConcentrationFinal}</td>
                        <c:if test="${!fn:contains(businesConfig, '101')}">
                            <td>${order.osmoticPressureFinal}</td>
                        </c:if>
                        <td>${order.rt == 1 ? '不留腹' : order.rtOther}</td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
        </c:if>
        <c:if test="${pdSchemeMode=='1'}">
            <div class="layui-form-item">
                <c:if test="${fn:length(dialysisScheme.apdMaps) > 0}">
                    <table class="layui-table" id="orderTable1">
                        <thead>
                        <tr>
                            <th style="text-align: center">治疗模式</th>
                            <th style="text-align: center">APD具体模式</th>
                            <th style="text-align: center">总治疗量</th>
                            <th style="text-align: center">总治疗时间</th>
                            <th style="text-align: center">周期数(次)</th>
                            <th style="text-align: center">每周期用量</th>
                            <th style="text-align: center">潮式比</th>
                            <th style="text-align: center">实际透析剂量</th>
                        </tr>
                        </thead>
                        <tbody>
                        <c:forEach items="${dialysisScheme.apdMaps}" var="item">
                            <c:forEach items="${item.value}" var="var" varStatus="status">
                                <tr>
                                    <c:if test="${status.first}">
                                        <td style="text-align: center"
                                            rowspan="${fn:length(item.value)}">${var.dialysisMode}</td>
                                    </c:if>
                                    <td style="text-align: center">${var.dialysisModeApd}</td>
                                    <td style="text-align: center">${var.allTreatmentVolume}</td>
                                    <td style="text-align: center">${var.allTreatmentTime}</td>
                                    <td style="text-align: center">${var.cycleNumber}</td>
                                    <td style="text-align: center">${var.everyTreatmentVolume}</td>
                                    <td style="text-align: center">${var.apdtpdPercentInput}</td>
                                    <td style="text-align: center">${var.allTreatmentDose}</td>
                                </tr>
                            </c:forEach>
                        </c:forEach>
                        </tbody>
                    </table>
                </c:if>

                <c:if test="${fn:length(dialysisScheme.apdNotMaps) > 0}">
                    <table class="layui-table" id="orderTable2">
                        <thead>
                        <tr>
                            <th style="text-align: center">治疗模式</th>
                            <th style="text-align: center">透析液类型</th>
                            <th style="text-align: center">浓度选择</th>
                            <th style="text-align: center">每天透析袋袋数</th>
                            <th style="text-align: center">留腹时间(h)</th>
                        </tr>
                        </thead>
                        <tbody>
                        <c:forEach items="${dialysisScheme.apdNotMaps}" var="item">
                            <c:forEach items="${item.value}" var="var" varStatus="status">
                                <tr>
                                    <c:if test="${status.first}">
                                        <td rowspan="${fn:length(item.value)}">${var.dialysisMode}</td>
                                    </c:if>
                                    <td>${var.solutionName}</td>
                                    <td>${var.concentration}</td>
                                    <td>${var.numberOfDialysisBagsPerDayName}</td>
                                    <td>${var.abdominalRetentionTimeName}</td>
                                </tr>
                            </c:forEach>
                        </c:forEach>
                        </tbody>
                    </table>
                </c:if>
            </div>
        </c:if>
        <div style="margin-top: 10px;">
            <label class="print_label">其他说明：${dialysisScheme.remarks}</label>
        </div>
    </div>

</div>